<!doctype html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="icon" href="../dist/img/favicon-32x32.png" sizes="32x32" type="image/png">
    <link rel="icon" href="../dist/img/favicon-16x16.png" sizes="16x16" type="image/png">
    <meta name="keywords" content="响应式后台模板,开源免费后台模板,Bootstrap5后台管理系统模板">
    <meta name="description" content="bootstrap-admin基于bootstrap5的免费开源的响应式后台管理模板">
    <meta name="author" content="ajiho">
    <link rel="stylesheet" href="../lib/bootstrap-icons/font/bootstrap-icons.min.css">
    <link rel="stylesheet" href="../lib/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../dist/css/bootstrap-admin.min.css">
    <title>bootstrap-admin开源免费响应式后台管理系统模板</title>
</head>
<body class="bg-body-tertiary py-3">
<div class="container-fluid">

    <div class="row g-3">
        <div class="col-md-6">
            <div class="card border-0 shadow-sm">
                <div class="card-header bg-body">
                    基本示例
                </div>
                <div class="card-body">
                    <div id="raty"></div>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <div class="card border-0 shadow-sm">
                <div class="card-header bg-body">
                    开启只读模式
                </div>
                <div class="card-body">
                    <div id="raty2"></div>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <div class="card border-0 shadow-sm">
                <div class="card-header bg-body">
                    点击事件回调
                </div>
                <div class="card-body">
                    <div id="raty3"></div>
                </div>
            </div>
        </div>

        <div class="col-md-6">
            <div class="card border-0 shadow-sm">
                <div class="card-header bg-body">
                    开启半星模式
                </div>
                <div class="card-body">
                    <div id="raty4"></div>
                </div>
            </div>
        </div>

    </div>

    <!--回到顶部开始-->
    <a href="javaScript:" class="bsa-back-to-top"><i class='bi bi-arrow-up-short'></i></a>
    <!--回到顶部结束-->

</div>

<script src="../lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="../lib/jquery/dist/jquery.min.js"></script>
<script src="../lib/raty-js/lib/jquery.raty.js"></script>
<script src="../dist/js/bootstrap-admin.min.js"></script>
<script src="../dist/js/app.js"></script>
<script>
    $(document).ready(function (e) {
        $('#raty').raty({
            // 隐藏域字段
            scoreName: 'score',
            // 初始化值
            score: 1,
            // 数量
            number: 5,
            readOnly: false,
            starType: 'i',
            cancelOff: "bi bi-x-circle fs-4 mx-1 text-danger",
            cancelOn: "bi bi-x-circle fs-4 mx-1",
            starHalf: "bi bi-star-half fs-4 mx-1 text-success",
            starOff: "bi bi-star fs-4 mx-1 text-secondary",
            starOn: "bi bi-star-fill fs-4 mx-1 text-success",
        });

        $('#raty2').raty({
            // 隐藏域字段
            scoreName: 'score',
            // 开启半星
            halfShow: true,
            // 初始化值
            score: 1,
            // 数量
            number: 5,
            readOnly: true,
            starType: 'i',
            cancelOff: "bi bi-x-circle fs-4 mx-1 text-danger",
            cancelOn: "bi bi-x-circle fs-4 mx-1",
            starHalf: "bi bi-star-half fs-4 mx-1 text-success",
            starOff: "bi bi-star fs-4 mx-1 text-secondary",
            starOn: "bi bi-star-fill fs-4 mx-1 text-success",
        });

        $('#raty3').raty({
            // 隐藏域字段
            scoreName: 'score',
            // 初始化值
            score: 1,
            // 数量
            number: 5,
            starType: 'i',
            cancelOff: "bi bi-x-circle fs-4 mx-1 text-danger",
            cancelOn: "bi bi-x-circle fs-4 mx-1",
            starHalf: "bi bi-star-half fs-4 mx-1 text-success",
            starOff: "bi bi-star fs-4 mx-1 text-secondary",
            starOn: "bi bi-star-fill fs-4 mx-1 text-success",
            click: function (score, e) {
                alert('当前分值:' + score)
            }
        });


        $('#raty4').raty({
            // 隐藏域字段
            scoreName: 'score',
            // 开启半星
            precision: true,
            halfShow: true,
            // 初始化值
            score: 1,
            // 数量
            number: 5,
            starType: 'i',
            cancelOff: "bi bi-x-circle fs-4 mx-1 text-danger",
            cancelOn: "bi bi-x-circle fs-4 mx-1",
            starHalf: "bi bi-star-half fs-4 mx-1 text-success",
            starOff: "bi bi-star fs-4 mx-1 text-secondary",
            starOn: "bi bi-star-fill fs-4 mx-1 text-success",
            click: function (score, e) {
                alert('当前分值:' + score)
            }
        });


    })

</script>
</body>
</html>